<?php print "<?php"; ?>

/**
 * @file
 * <?php print $type; ?> database info.
 */

function <?php print $type; ?>_schema() {
  $schema['<?php print $type; ?>'] = array(
    'description' => 'Stores <?php print $type; ?> data.',
    'fields' => array(
      '<?php print substr($type, 0, 1 ); ?>id' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => 'ID of <?php print $type; ?>.',
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 60,
        'not null' => TRUE,
        'default' => '',
        'description' => '<?php print $type; ?> title.',
      ),
<?php foreach($fields as $field): ?>
<?php if($field['type'] == 'int'): ?>
      '<?php print $field['name']; ?>' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => <?php print $field['type_setting']['notnull']; ?>,
        'default' => <?php print $field['type_setting']['default']; ?>,
        'description' => '<?php print $type; ?> <?php print $field['name']; ?>.',
      ),
      <?php elseif($field['type'] == 'text'): ?>
'<?php print $field['name']; ?>' => array(
        'type' => 'text',
        'size' => 'normal',
        'description' => "<?php print $type; ?> <?php print $field['name']; ?>.",
      ),
      <?php elseif($field['type'] == 'blob'): ?>
'<?php print $field['name']; ?>' => array(
        'type' => 'blob',
        'not null' => <?php print $field['type_setting']['notnull']; ?>,
        'size' => 'big',
        'description' => '<?php print $type; ?> <?php print $field['name']; ?>.',
      ),
      <?php else: ?>
'<?php print $field['name']; ?>' => array(
        'type' => 'varchar',
        'length' => <?php print $field['type_setting']['length']; ?>,
        'not null' => <?php print $field['type_setting']['notnull']; ?>,
        'default' => '<?php print $field['type_setting']['default']; ?>',
        'description' => '<?php print $type; ?> <?php print $field['name']; ?>.',
      ),
<?php endif; ?>
<?php endforeach; ?>
'uid' => array(
        'type' => 'varchar',
        'length' => 60,
        'not null' => TRUE,
        'default' => '',
        'description' => "page uid.",
      ),
      'created' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The Unix timestamp when the user was created.',
      ),
      'updated' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The Unix timestamp when the user was updated.',
      ),
    ),
    'primary key' => array('<?php print substr($type, 0, 1 ); ?>id'),
  );

  return $schema;
}

/**
 * Insert init <?php print $type; ?>.
 */
function <?php print $type; ?>_install() {

}
